package com.snack.dao.impl.admin;

import com.snack.dao.admin.RoleDAO;
import com.snack.db.DbHelper;
import com.snack.entity.admin.Role;

public class RoleDAOImpl implements RoleDAO {

	@Override
	public int save(Role role) {
		return DbHelper.execute("INSTER INTO S_ROLE (NAME) VALUE (?)", role.getName());
	}

	@Override
	public int update(Role role) {
		return DbHelper.execute("UPDATE S_ROLE SET C_NAME=? WHERE ID=?", role.getName(), role.getId());
	}

	@Override
	public int delete(int id) {
		return DbHelper.execute("DELETE S_ROLE WHERE ID=?", id);
	}

}
